<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>host-config-common</title>
	<%@ include file="../include/common.jsp"%>
	<%@ include file="../include/jbox.jsp"%>
	<%@ include file="../include/table.jsp"%>
	
	
	<link rel="stylesheet" type="text/css"
	     href="${pageContext.request.contextPath}/style/default/bsm/selfmainten/probe.css" />
	<script type="text/javascript">
	
	$(function(){
		//加载grid
		var oTable=	$('#probelist').dataTable({
			"bProcessing": false, 
			"bServerSide": true,
			"sServerMethod": 'POST',
			"sAjaxSource":'${pageContext.request.contextPath}/selfmainten/probe!list.action',
			"bPaginate": false,
			"bSort": true,
			"bFilter":false,
			//"sScrollY": "490px",
			"bJQueryUI":false,
			"sPaginationType": "full_numbers",
			//"sScrollX":'100%',
			"sDom":'rt <"bottom"flpi>',
			"aoColumns":[
				{"mDataProp":"op","":"center","bSortable": false},
				{"mDataProp":"id"},
				{"mDataProp":"status","bSortable": false},
				{"mDataProp":"name","bSortable": false},
				{"mDataProp":"ip","bSortable": false},
				{"mDataProp":"type","bSortable": false},
				{"mDataProp":"task","bSortable": false},
				{"mDataProp":"time","bSortable": false}
			], 
			 "oLanguage": {
				 "sInfo": "共 _TOTAL_ 条记录", 
					"sInfoEmpty": "没有找到记录"
			},
		    "fnServerParams":function(aoData){
		    	var ip = $('#ip').val();
		    	if(ip!='')
		    	{
		    		aoData.push({'name':'ip','value':ip});
		    	}
		    }
	   });
	});
	
	
	var timeout = 20;
	function timer(){
        $('#timeCount').css('font','#ff0000').text(timeout);
        
        if (timeout == 0) {
        	location.reload();
        }
        else {
            setTimeout("timer()", 1000);
        }
        timeout--;
	}
	
	function restart(probeId){
		window.setTimeout(function () { $.jBox.tip('正在重启  20s 后页面自动刷新...', 'success'); }, 100);
		timer();
		$.ajax({
			url : 'probe!restartProbe.action', // 
			type : 'POST',
			dataType : "json",
			data : {
				id:probeId
			},
			success : function(data) {
				
			}
		});
	}
	
	function checkStatus(id){
		location.assign("probe!diagnosis.action?id="+id);
	}
	
	
  </script>
  </head>
  <body>
  
	<div>
		<table id="probelist" name="probelist" width="99%" cellpadding="0" cellspacing="0" border="0" class="display" >
			<thead>
				<tr>
					<th width="3%">操作</th>
					<th width="2%">ID</th>
					<th width="2%">状态</th>
					<th width="5%">名称</th>
					<th width="5%">主机名</th>
					<th width="3%">类别</th>
					<th width="4%">任务数</th>
					<th width="6%">启动时间</th>
				</tr>
			</thead>
		</table>
	</div>
</body>
</html>
